package com.bestv.engine.model;

import java.io.Serializable;

/**
 * Created by Henry on 14-5-20.
 */
public class RecommendationItem implements Serializable {
    private Long id;
    private String itemId;
    private boolean isSeries;
    private String modelName;
    private boolean isCharge;
    private String name;
    private double score;
    private int typeId;
    private String domain;
    private String biz;
    private String category;

    private double genreScore;

    @Override
    public String toString() {
        return String.format("[itemId: %s, isSeries: %s, modelName: %s, isCharge: %s, name: %s, score: %s]",
                itemId, isSeries, modelName, isCharge, name, score);
    }

    public String toXML() {
        StringBuilder sbItem = new StringBuilder();
        sbItem.append("<item>");
        sbItem.append(String.format("<iid>%s</iid>", itemId));
        sbItem.append(String.format("<biz>%s</biz>", biz));
        sbItem.append(String.format("<category>%s</category>", category));
        sbItem.append(String.format("<isseries>%s</isseries>", isSeries));
        sbItem.append(String.format("<modelid>%s</modelid>", modelName));
        sbItem.append(String.format("<ischarge>%s</ischarge>", isCharge));
        sbItem.append("</item>");
        return sbItem.toString();
    }

    public String toHTML() {
        StringBuilder sbItem = new StringBuilder();
        sbItem.append("<tr>");
        sbItem.append(String.format("<td>%s</td>", itemId));
        sbItem.append(String.format("<td>%s</td>", biz));
        sbItem.append(String.format("<td>%s</td>", category));
        sbItem.append(String.format("<td>%s</td>", name));
        sbItem.append(String.format("<td>%s</td>", isSeries));
        sbItem.append(String.format("<td>%s</td>", typeId));
        sbItem.append(String.format("<td>%s</td>", isCharge));
        sbItem.append(String.format("<td>%s</td>", modelName));
        sbItem.append(String.format("<td>%s</td>", score));
        sbItem.append("</tr>");
        return sbItem.toString();
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getItemId() {
        return itemId;
    }

    public void setItemId(String itemId) {
        this.itemId = itemId;
    }

    public boolean isSeries() {
        return isSeries;
    }

    public void setSeries(boolean isSeries) {
        this.isSeries = isSeries;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }

    public boolean isCharge() {
        return isCharge;
    }

    public void setCharge(boolean isCharge) {
        this.isCharge = isCharge;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }

    public int getTypeId() {
        return typeId;
    }

    public void setTypeId(int typeId) {
        this.typeId = typeId;
    }

    public double getGenreScore() {
        return genreScore;
    }

    public void setGenreScore(double genreScore) {
        this.genreScore = genreScore;
    }

    public String getDomain() {
        return domain;
    }

    public void setDomain(String domain) {
        this.domain = domain;
    }

    public String getBiz() {
        return biz;
    }

    public void setBiz(String biz) {
        this.biz = biz;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }
}
